import { CoolCommException } from "@cool-midway/core";
import { Rule, RuleType } from "@midwayjs/validate";

export class AddCarDTO {
  @Rule(RuleType.string().required().max(20).error(new CoolCommException('车牌号不能为空')))
  licensePlate: string;

  @Rule(RuleType.string().required().max(50).error(new CoolCommException('车辆型号不能为空')))
  model: string;

  @Rule(RuleType.number().required().error(new CoolCommException('车辆类型不能为空')))
  typeId: number;

  @Rule(RuleType.string().optional().allow('').max(50))
  brand?: string;

  @Rule(RuleType.string().optional().allow(''))
  photo?: string;

  @Rule(RuleType.string().optional().allow(''))
  remark?: string;

  @Rule(RuleType.string().optional().allow(''))
  tags?: string;

  @Rule(RuleType.string().optional().allow('').max(20))
  color?: string;
}

